# -*- coding: utf-8 -*-
'''
@Software: PyCharm
@File    : data_helper.py
@Author  : Bryan SHEN
@E-mail  : m18801919240_3@163.com
@Site    : Shanghai, China
@Time    : 2021-09-08
@Description: 
'''

import json
import pandas as pd

items = [item for item in json.loads(open("new_live_comments.json", encoding="utf-8").read())]

new_items = []
for item in items:

    dic = {}
    dic["nickname"] = item["user"]["nickname"]
    dic["content"] = item["content"]
    new_items.append(dic)

data = pd.DataFrame(new_items)

data.to_excel("clean_data.xlsx", index=False)
